home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / super-3.7 / super-3 / super-3.7.2.linux / Makefile < prev    next >
Makefile  |  1995-08-30  |  10KB  |  249 lines

  1.  
  2. #######
  3. # Where the executable goes
  4. BINDIR=/usr/local/bin
  5.  
  6. #######
  7. # Man pages
  8.  
  9. # Directory for super(1) man page
  10. MANDIR=/usr/local/man/man1
  11.  
  12. # Extension on the super(1) man page
  13. MANEXT=1
  14.  
  15. # Directory for the man page describing the format of the super.tab file.
  16. # Note: file formats usually go into section 4 (SysV) or section 5 (BSD).
  17. MAN_FMT_DIR=/usr/local/man/man4
  18.  
  19. # Extension on the super.tab format man page.
  20. MAN_FMT_EXT=4
  21.  
  22. #######
  23. # CC
  24. CC=cc
  25.  
  26. #######
  27. # CFLAGS
  28.  
  29. #   1. USE_NETGROUP: This indicates whether the hostname "+xxx" should mean
  30. #    any host in netgroup "xxx"; e.g. `joe@+xyz' means allow
  31. #    joe to execute the command from any host in NIS netgroup xyz.
  32. #    If USE_NETGROUP is not defined, `joe@+xyz' means joe at host `+xyz'.
  33. #    (Netgroups are typically defined in /etc/netgroup on your NIS master.)
  34.  
  35. #   2. USE_SYSLOG: This indicates whether the error-message printing routine
  36. #    should be compiled with the option of calling syslog().  You should
  37. #    define this if you have syslog() available.  The actual printing to
  38. #    syslog at runtime is controlled by the global option syslog=y|n.
  39. #    See also SYSLOG_PRIORITY, below.
  40.  
  41. #   3. MAXFD: if you don't have the system call getdtablesize() to return the
  42. #    number of file descriptors, define
  43. #        MAXFD=<expression to give max ok value of a file descr>.
  44. #    If MAXFD is not defined, getdtablesize() is used.
  45. #    Examples:     -DMAXFD=63    -- hardwired for 64 max descriptors;
  46. #            -DMAXFD="sysconf(_SC_OPEN_MAX)-1" -- HP-UX 8.x, 9.x
  47.  
  48. #   4. SUPERFILE: if you want the superfile to be other than
  49. #    /usr/local/lib/super.tab, add -DSUPERFILE=\"FullPathName\"
  50.  
  51. #   5. SAFE_PATH: this is the setting of the PATH variable for any command
  52. #    executed by super.  The default is "/bin:/usr/bin:/usr/ucb".
  53. #    If you prefer a different path, add -DSAFE_PATH=\"MyPreferredPath\",
  54. #    and change the description of PATH in the man page to match.
  55.  
  56. #   6. TIMESTAMP_DIR: This is the directory in which timestamp files are
  57. #    kept for commands requiring passwords to be entered.  The default
  58. #    is "/usr/local/lib/superstamps".  If you prefer a different path,
  59. #    add -DTIMESTAMP_DIR=\"/My/Preferred/Directory\".
  60.  
  61. #   7. L14: define this if your filenames can only be 14 characters long.
  62. #    Timestamp filenames usually look like hostname/user; with this option,
  63. #    the hostname part is truncated to 14 characters.
  64.  
  65. #   8. INTERPRETER_HACK: If your execve() function doesn't support the
  66. #    "#!" hack, in which executable scripts beginning
  67. #        "#! interpreter [arg]"
  68. #    are automatically passed to the interpreter, define -DINTERPRETER_HACK.
  69. #    Super will include code to implement "#!" processing.
  70.  
  71. #   9. USE_GETHOSTBYNAME: If you have a nameserver, you should enable
  72. #    this, which does the following:  If super tries and fails to match
  73. #    the hostname (as returned by gethostname()), it will try removing
  74. #    trailing components of the fully-qualified hostname and seeing if
  75. #    they match the host pattern.
  76.  
  77. #   10. SCO: if you are compiling for SCO 3.2v4 unix use this define.
  78.  
  79. #   11. SCO_SHADOW_PWD: Depending on the defined level of security used
  80. #    on an SCO platform (i.e. traditional, low, medium, or high), the 
  81. #    encrypted user passwords are contained in the /etc/shadow file.
  82. #    For all levels except low, you must define SCO_SHADOW_PWD, so that the
  83. #     get_password routine retrieves the password from the proper file.
  84.  
  85. #   12. ONETRUENAME: the name under which the program assumes it is installed.
  86. #    If argv[0] isn't [/.../]ONETRUENAME, we assume we're running via
  87. #    symlink, and act as if `super xxx args' had been typed instead of
  88. #    `super args', where xxx is argv[0].  The default is "super", and
  89. #    you should _not_ change this without a good reason!
  90.  
  91. #   13. RLOG_MACHINE: If you enable the use of syslog() (-DUSE_SYSLOG),
  92. #    by default standard syslog() calls will be used.  But you also have
  93. #    the option of using rsyslog(), which will direct the syslog messages to
  94. #    a host on your network.  If you want to use rsyslog(), then you
  95. #    must define RLOG_MACHINE, and you should also define SYSLOG_PRIORITY
  96. #    (see following item).  RLOG_MACHINE specifies the machine
  97. #    which will receive the networked syslog messages.  For example:
  98. #        -DRLOG_MACHINE=\"toto.domain\"
  99. #    (If you distribute this code, be careful to remove the name of
  100. #    your collecting machine from this Makefile.  Note that the "make
  101. #    shar" command, below, will strip this for you.).
  102.  
  103. #   14. SYSLOG_PRIORITY: This variable specifies the priority of syslog
  104. #    messages.  If you don't define it, the default is LOG_ERR.
  105. #    (Regardless of this setting, _successful_ executions are logged
  106. #    at priority LOG_INFO.)
  107.  
  108. #    If you are using standard syslog(), you may define it symbolically,
  109. #    for example:
  110. #        -DSYSLOG_PRIORITY=LOG_ERR
  111. #    or
  112. #        -DSYSLOG_PRIORITY="(LOG_LOCAL1 | LOG_WARNING)"
  113.  
  114. #    But if you are using rsyslog(), you should define it differently:
  115. #    its value depends on the machine which will _receive_ the log
  116. #    messages, NOT the sending machine.  It should be defined in the
  117. #    Makefile because the value can differ on the machine that compiles
  118. #    and runs super, compared to the value on the log host.
  119.  
  120. #    For example, if your receiving machine is a Sun running SunOS 4.1.3,
  121. #    or HP-UX 8.x or 9.x, using -DRLOG_PRIORITY='((17<<3)+4)' will set
  122. #    the priority of the networked syslog to the facility LOG_LOCAL1, with
  123. #    the priority LOG_WARNING.  The log machine should have a line that
  124. #    matches this in its syslog.conf file; for the above priority, use
  125. #    an entry like:
  126. #        /etc/syslog.conf:local1.warning        /var/adm/super.log
  127.  
  128. #   3. NEED_MEMSET: This indicates whether you have a memset() routine.
  129. #    If you don't, define -DNEED_MEMSET and one will be compiled for you.
  130.  
  131. # AIX
  132. # CFLAGS= -O -DUSE_NETGROUP -DUSE_SYSLOG -DUSE_GETHOSTBYNAME
  133.  
  134. # HP-UX 9.01:
  135. #    Note: unpatched HP-UX 9.01 c89 has a bug, so that compiling with -O
  136. #    doesn't work.  Patched version is OK.
  137. # CFLAGS= -Aa -D_HPUX_SOURCE -DUSE_NETGROUP -DMAXFD="sysconf(_SC_OPEN_MAX)-1" -DUSE_SYSLOG -DUSE_GETHOSTBYNAME -DRLOG_MACHINE=\"toto.domain\" -DSYSLOG_PRIORITY='((17<<3)+4)'
  138.  
  139. # IRIX v4.0.5:
  140. # CFLAGS= -g -DUSE_NETGROUP -DSAFE_PATH=\"/bin:/usr/bin:/usr/bsd\"  -DUSE_SYSLOG -DUSE_GETHOSTBYNAME
  141.  
  142. # Solaris 2.2, 2.3; SunOS 5.2, 5.3:
  143. # CFLAGS= -O -DUSE_NETGROUP -DMAXFD="sysconf(_SC_OPEN_MAX)-1"  -DSUNOS5 -DUSE_SYSLOG -DUSE_GETHOSTBYNAME
  144.  
  145. # SunOS 4.1.3:
  146. # CFLAGS= -O -DUSE_NETGROUP -DUSE_SYSLOG -DUSE_GETHOSTBYNAME -DRLOG_MACHINE=\"toto.domain\" -DSYSLOG_PRIORITY='((17<<3)+4)'
  147.  
  148.  
  149. # Clix 3.1 r.7.1.3 (Intergraph)
  150. # CFLAGS=  -O -DUSE_NETGROUP -DINTERPRETER_HACK
  151.  
  152. # SCO 3.2v4
  153. # CFLAGS= -g -DSCO -DSCO_SHADOW_PWD -DUSE_SYSLOG 
  154.  
  155. # Linux 1.2.x
  156. CFLAGS = -Wall -O6 -DUSE_SYSLOG -DSAFE_PATH=\"/bin:/usr/bin\" -DTIMESTAMP_DIR=\"/var/lib/super\" 
  157.  
  158. #######
  159. # LDFLAGS,LDLIBS
  160.  
  161. # AIX
  162. # LDFLAGS=
  163. # LDLIBS=
  164.  
  165. # HP-UX 9.01:
  166. LDFLAGS=
  167. LDLIBS=
  168.  
  169. # IRIX v4.0.5:    -lsun is for the NIS stuff (so that you can use
  170. #    netgroup entries).  -lmalloc avoids a problem with the
  171. #    default malloc routine that causes a core dump.
  172. # LDFLAGS =
  173. # LDLIBS = -lmalloc -lsun
  174.  
  175. # Solaris 2.2, 2.3: don't use -Bstatic or -static: it should not be needed
  176. # for security (see LD_LIBRARY_PATH in ld(1)), and the groupname-lookup
  177. # routines are for some reason only available in shared libs (see getgrnam(3)).
  178. # LDFLAGS=
  179. # LDLIBS= -lnsl
  180.  
  181. # SunOS 4.1.3: no special flags needed.  N.B.: If you use SunOS 4.0.x, you
  182. # should link statically for security.  (I don't know about the proper
  183. # flags for SunOS 4.1.1).
  184. # LDFLAGS=
  185. # LDLIBS=
  186.  
  187. # Clix 3.1 r.7.1.3 (Intergraph)
  188. # LDFLAGS=
  189. # LDLIBS=-lbsd
  190.  
  191. # SCO 3.2v4
  192. # LDFLAGS=
  193. # LDLIBS= -lsocket -lmalloc -lufc -lsec
  194.  
  195.  
  196. ####################################################################
  197. # You shouldn't have to modify anything below this line.
  198. ####################################################################
  199.  
  200. SRC= super.c strqtokS.c regex.c re_fail.c braces.c error.c wildmat.c rsyslog.c version.h
  201. OBJ= super.o strqtokS.o regex.o re_fail.o braces.o error.o wildmat.o rsyslog.o
  202. ALL= README Artistic Copying WhatsNew Makefile super.1 super.5 sample.tab sample.cdmount $(SRC)
  203.  
  204. all: super
  205.  
  206. super: $(OBJ)
  207.     $(CC) $(LDFLAGS) -o super $(OBJ) $(LDLIBS)
  208.  
  209. # NOTICE NOTICE NOTICE!
  210. # You must install super as "super", and not use any other program name.
  211. # This is because at run-time, the program assumes that if it's invoked
  212. # with a different name, it must have been invoked via a symlink, and
  213. # it treats
  214. #    % myothernameforsuper args
  215. # as if you typed
  216. #    % super myothernameforsuper args
  217. # If you insist on installing under another name, then you must
  218. # change the #define ONETRUENAME from "super" to your other
  219. # name, and edit the documentation to match.
  220. install:
  221.     cp super $(BINDIR)/super
  222.     chmod 04755 $(BINDIR)/super
  223.     cp super.1 $(MANDIR)/super.$(MANEXT)
  224.     cp super.5 $(MAN_FMT_DIR)/super.$(MAN_FMT_EXT)
  225.  
  226. clean:
  227.     rm -f super *.o
  228.  
  229. $(ALL): 
  230.     co $@
  231.  
  232. # Because of the wide variation in shar commands, the shar arguments
  233. # used below sticks to a minimal set, and we generate various shar file
  234. # headers by hand.  
  235. shar: $(ALL)
  236.     ( echo "#include <stdio.h>" ; \
  237.     echo '#include "version.h"' ; \
  238.     echo 'main() {printf("%s.%s\\n",Version,Patchlevel);exit(0);}') > temp.c
  239.     cc temp.c
  240.     V=super-`a.out`; mkdir $$V && cp $(ALL) $$V && \
  241.         sed -e 's/-DRLOG_MACHINE=\"toto.domain\"]*"/-DRLOG_MACHINE=\\"toto.domain\\"/' Makefile >> $$V/Makefile.orig && \
  242.         chmod +w $$V/Makefile && \
  243.         cp $$V/Makefile.orig $$V/Makefile && \
  244.         (echo "Submitted-by: will@nfra.nl" ; \
  245.         echo "Archive-name: $$V/part01" ; echo "" ; \
  246.         echo "---- Cut Here and feed the following to sh ----" ; \
  247.         shar $$V ) > $$V.shar && rm -rf $$V
  248.     rm a.out temp.c
  249.